Hi Fred,
The PC, MS Windows, and consequentially the USB are not real time, which is why motion commands need to be buffered within KFLOP, so I don't think you want to do things before or after data is sent to KFLOP. Do so could have huge delays. KMotionCNC allows you to include SetBitBuf and ClearBitBuf Console commands into the Motion Data Stream. This allows IO to switch synchronously with motion. Also Switching a Virtual IO bit can be used to trigger something in a KFLOP USer Program if you wish. Can you use that mechanism?
Regards
TK